import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.util.*;
import javax.swing.event.*;
import java.lang.reflect.*;
import java.net.*;
import java.util.List;

class MemberType extends JFrame
{
		Container contain;
        JPasswordField password;

        JTextField text1;
        JButton button1,button2;
        JLabel label1,label2,label3;
        JPanel panel1,panel2,panel3;
        JComboBox memberTypeCB;
        String [] memberType = {" ", "faculty", "student"};


MemberType(){
super("MemberType ");

contain=getContentPane();
contain.setLayout(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

panel1=new JPanel(null,true);
label1=new JLabel("Member Type");
label1.setForeground(Color.black);
label1.setBounds(10,10,120,25);
panel1.add(label1);

memberTypeCB=new JComboBox(memberType);
memberTypeCB.setEditable(false);
memberTypeCB.setBounds(100,10,120,25);
panel1.add(memberTypeCB);

label3=new JLabel();
label3.setBounds(75,115,350,25);
panel1.add(label3);

button1=new JButton("Ok");
button1.setBounds(20,90,100,25);
panel1.add(button1);

button2=new JButton("Cancel");
button2.setBounds(130,90,100,25);
panel1.add(button2);

Color r3=new Color(122,145,201);
panel1.setBounds(0,0,260,260);
contain.add(panel1);


	button1.addActionListener(new ActionListener(){
	public void actionPerformed(ActionEvent e){	
	if(memberTypeCB.getSelectedItem().toString().equalsIgnoreCase("Faculty")){
    try {
		Login s=new Login();

		s.setVisible(true);
     dispose();
		s.setSize(270,180);
		s.setLocation(500,250);
    } catch (Exception err) {
        err.printStackTrace();
    }

	}
	 else if(memberTypeCB.getSelectedItem().toString().equalsIgnoreCase("Student")){
		LoginS r=new LoginS();

		r.setVisible(true);
     dispose();
		r.setSize(270,180);
		r.setLocation(500,250);
	}
	
	else{
		label3.setText("Invalid User!");
		label3.setForeground(Color.red);
	}

	}
	});
	

	button2.addActionListener(new ActionListener()
	{
	public void actionPerformed(ActionEvent e){
		System.exit(0);
	
	}
	});
	
}

}
